<template>
  <div>
    <el-table
      :data="memberList"
      style="width: 100%"
      node-key="id"
      border
      :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
    >
      <el-table-column prop="uid" label="用户编号" width="180">
      </el-table-column>
      <el-table-column prop="nickname" label="昵称" width="180">
      </el-table-column>
      <el-table-column prop="phone" label="手机号" width="180">
      </el-table-column>
      <el-table-column prop="status" label="状态">
        <template slot-scope="scope">
          <div>
            <el-button type="primary" v-if="scope.row.status == 1"
              >启 用</el-button
            >
            <el-button type="success" v-else>禁 用</el-button>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <div>
            <el-button type="info" @click="edit(scope.row.uid)">编 辑</el-button>
          </div>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
import { mapGetters, mapActions } from "vuex";
export default {
  props: ["obj"],
  components: {},
  data() {
    return {
    };
  },
  computed: {
    ...mapGetters({
      memberList:"member/list",
    }),
  },
  methods: {
    ...mapActions({
       asyncMemberList:"member/asyncList"
    }),
    edit(uid) {
      // 通知父组件，我点了编辑
      this.$emit("edit",uid)
    },
  },
  mounted() {
  this.asyncMemberList()
  },
};
</script>
<style scoped>
</style>